<template>
  <div>
    <p>音频波形测试</p>
    <av-media
      :media="media"
      type="frequ"
      frequ-direction="mo"
      :frequ-lnum="60"
      line-color="#0f0"
    />
  </div>
</template>

<script>
export default {
  components: {},
  name: "",
  data() {
    return {
      media: null,
    };
  },
  mounted() {
    this.getStream();
  },
  methods: {
    getStream() {
      navigator.mediaDevices.getUserMedia({ audio: true }).then((media) => {
        this.media = media; 
      });
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped></style>
